<div class="box-content">
	<?php echo $this -> Form -> create('Account', array('enctype' => 'multipart/form-data', 'class' => 'form-horizontal', 'url' => '/Accounts/addNewAccount', 'id' => 'signupForm')); ?>
	<fieldset>
		<div class="control-group">
			<label class="control-label" for="focusedInput">Username</label>
			<div class="controls">
				<?php 
				echo $this -> Form -> input('id', array('type' => 'hidden'));

				if($this->data){
						echo $this -> Form -> input('username', array('label' => '', 'class' => 'input-xlarge', 'disabled'=>'disabled', 'type' => 'text', 'id' => "focusedInput"));
				}else{
						echo $this -> Form -> input('username', array('label' => '', 'class' => 'input-xlarge', 'type' => 'text', 'id' => "focusedInput")); 
				}
				?>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">Gender</label>
			<div class="controls">
				<?php $options = array('1' => 'Male', '2' => 'Female', '3' => 'Other');
				echo $this -> Form -> select('gender', $options, array('empty' => FALSE, 'label' => '', 'class' => 'input focused', 'data-rel'=>"chosen"));
				?>
				<label id='err_gender'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputfullname">Fullname</label>
			<div class="controls">
				<?php echo $this -> Form -> input('fullname', array('label' => '', 'class' => 'input-xlarge focused', 'type' => 'text', 'id' => "inputfullname")); ?>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputphone">Phone</label>
			<div class="controls">
				<?php echo $this -> Form -> input('phone', array('label' => '', 'class' => 'input-xlarge focused', 'type' => 'text', 'id' => "inputphone")); ?>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputemail">Email</label>
			<div class="controls">
				<?php echo $this -> Form -> input('email', array('label' => '', 'class' => 'input-xlarge focused', 'type' => 'text', 'id' => "inputemail")); ?>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">Select Team</label>
			<div class="controls">
				<?php echo $this -> Form -> select('team_id', $team, array('empty' => FALSE, 'class' => 'form-control focused pageRequired', 'data-rel'=>"chosen")); ?>
				<label id='err_project'/>
			</div>
		</div>
        <div class="control-group">
            <label class="control-label">Select Role</label>
            <div class="controls">
                <?php echo $this -> Form -> select('role_id', $role_list, array('empty' => FALSE, 'class' => 'form-control focused pageRequired', 'data-rel'=>"chosen", 'default'=>400)); ?>
                <label id='err_role'/>
            </div>
        </div>
		<?php
		if(isset($account['Account']['is_delete'])){
		if($account['Account']['is_delete']){
		?>
		<div class="control-group">
			<label class="control-label" for="selectError1">Active</label>
			<div class="controls">
				<?php echo $this -> Form -> checkbox('is_delete', array('class' => 'iphone-toggle focused', 'data-no-uniform' => 'true', 'hiddenField' => false, 'value' => $account['Account']['is_delete'] ? '0' : '1'));
				?>
			</div>
		</div>
		<?php }
			}
		?>
		<div class="control-group">
			<label class="control-label">Image</label>
			<div class="controls">
				<?php if($this->data){
					
					 if($this->data['Account']['image']):?>	
					<img id="preview" src="<?php echo $this->data['Account']['image']?>" width='100px' height='100px'/>
						<?php else:
					 	echo $this->Html->image('no-image.png', array('id'=>'preview', 'width'=>'100px','height'=>'100px'));
					endif;
					}else{
						echo $this->Html->image('no-image.png', array('id'=>'preview', 'width'=>'100px','height'=>'100px'));
					}
				echo $this -> Form -> input('image', array('label' => '', 'class' => 'input-xlarge focused', 'type' => 'file', 'name' => 'image', 'onchange'=>'fileSelected();')); ?>
			</div>
		</div>
		<div class="form-actions">
			<?php echo $this -> Form -> submit('Save', array('div' => false, 'class' => 'btn btn-primary', 'id' => 'confirm_button'));
			echo ' ';
			echo $this -> Form -> button('Cancel', array('class' => 'btn', 'data-dismiss'=>"modal", 'id' => 'cancel_dialog_add', 'type' => 'reset'));
			?>
		</div>
	</fieldset>
	<?php echo $this -> Form -> end();
		echo $this -> Js -> writeBuffer(array('cache' => FALSE));
	?>
</div>
